package com.school.demo.util;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;

/**
 * @program: demo
 * @description: 一般返回结果类
 * @author: Charlotte
 * @create: 2021-03-23 18:17
 **/
@ApiModel(value = "一般返回结果类", description = "一般返回结果类")
public class Restful {

    @ApiModelProperty(value = "状态码")
    private Integer code;
    @ApiModelProperty(value = "消息")
    private String msg;
    @ApiModelProperty(value = "数据对象")
    private Object data;
    @ApiModelProperty(value = "其他信息")
    private Map<String,Object> result;

    public Restful(){

    }

    public Restful(Status status){
        code = status.code;
        msg = status.message;
    }

    public Restful(Status status,String msg){
        code = status.code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Map<String, Object> getResult() {
        return result;
    }

    public void setResult(Map<String, Object> result) {
        this.result = result;
    }
}
